package dao.oc_sea_area_ice;

import java.util.ArrayList;
import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import entitybean.oc_boat_ice.EntityBeanOc_Boat_Ice;
import entitybean.oc_property_tools_pla.EntityBean_Oc_Property_Tools_Pla;
import entitybean.oc_sea_area_ice.EntityBeanOc_Sea_Area_Ice;
public class DaoImpl_Oc_Sea_Area_Ice  extends HibernateDaoSupport implements Dao_Oc_Sea_Area_Ice{
	public void Insert_Oc_Sea_Area_Ice(EntityBeanOc_Sea_Area_Ice e)
	{
		this.getHibernateTemplate().save(e);
	}
	public void Update_Oc_Sea_Area_Ice(EntityBeanOc_Sea_Area_Ice e)
	{
		this.getHibernateTemplate().update(e);
	}
	public void Delete_Oc_Sea_Area_Ice(String id)
	{
		List<EntityBeanOc_Sea_Area_Ice> list=this.getHibernateTemplate().find("from EntityBeanOc_Sea_Area_Ice where del='OFF' and id in("+id+")");	
		for(int i=0;i<list.size();i++)
		{
			EntityBeanOc_Sea_Area_Ice e=list.get(i);
			e.setDel("ON");
			this.getHibernateTemplate().update(e);
			
		}
	}
	public EntityBeanOc_Sea_Area_Ice Find_EntityBeanOc_Sea_Area_Ice(Integer id) {
		EntityBeanOc_Sea_Area_Ice e=new EntityBeanOc_Sea_Area_Ice();
		List<EntityBeanOc_Sea_Area_Ice> list=this.getHibernateTemplate().find("from EntityBeanOc_Sea_Area_Ice where id="+id);
		if(list.size()>0)
		{
			e=list.get(0);
		}
		return e;
	}
	public List<EntityBeanOc_Sea_Area_Ice> Find_EntityBeanOc_Sea_Area_Ice() {
		List<EntityBeanOc_Sea_Area_Ice> list=new ArrayList<EntityBeanOc_Sea_Area_Ice>();
		list=this.getHibernateTemplate().find("from EntityBeanOc_Sea_Area_Ice where del='OFF' ");
		return list;
	}
	public List<EntityBeanOc_Sea_Area_Ice> Find_Oc_Sea_Area_Ice_ISACTIVE()
	{
		
		return this.getHibernateTemplate().find("from EntityBeanOc_Sea_Area_Ice where del='OFF'");
		
		
	}

}
